-
Notifications
You must be signed in to change notification settings - Fork 64
Implementation of Git repository support for the Malicious Packages repository. #1047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Caleb Brown <[email protected]>
Signed-off-by: Caleb Brown <[email protected]>
Signed-off-by: Caleb Brown <[email protected]>
Signed-off-by: Caleb Brown <[email protected]>
Signed-off-by: Caleb Brown <[email protected]>
Signed-off-by: Caleb Brown <[email protected]>
Signed-off-by: Caleb Brown <[email protected]>
Signed-off-by: Caleb Brown <[email protected]>
This allows doc changes to be iterated on differently. Signed-off-by: Caleb Brown <[email protected]>
Also adds tests to ensure the new validation rules work as expected. Signed-off-by: Caleb Brown <[email protected]>
| // There is a direct match, so return the handler immediately. | ||
| return handler | ||
| } | ||
| for suffix, handler := range gitHosts { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess iteration order will be random, if we ever have two suffix patterns that would match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is true. I have added a comment above to make this clearer.
For now I am okay with this.
internal/gitname/hosts.go
Outdated
| return checkPathParts(path, 2) | ||
| } | ||
|
|
||
| func checkPathParts(path string, partCount int) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment I guess - maybe count instead of partCount too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
internal/gitname/hosts.go
Outdated
| return true | ||
| } | ||
|
|
||
| // canonLowerOrg lowercases the first path component in the supplied path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
canonLowerOrgPath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
internal/report/validate.go
Outdated
|
|
||
| // validateGitCommtID ensures that candidate is a validly formatted git commit | ||
| // ID hash. Git commit IDs are a hex-encoded SHA1 or SHA256 hash. | ||
| func validateGitCommtID(candidate string, allowZero bool) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validateGitCommitID throughout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Signed-off-by: Caleb Brown <[email protected]>
See #1034 for the design doc.